import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('../views/News.vue'),
    children:[
      {
        path: '/news-home/:navIndex',
        name: 'news-home',
        component: () => import('../views/News-Home.vue')
      },
      {
        path: '/news-item/:id',
        name: 'news-item',
        component: () => import('../views/News-item.vue')
      },
    ]
  },
  {
    path: '/cause',
    name: 'cause',
    component: () => import('../views/Cause.vue')
  },
  {
    path: '/share',
    name: 'share',
    component: () => import('../views/Share.vue')
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue'),
    children:[
      {
        path: '/about',
        name: 'about-introduction',
        component: () => import('../views/About-introduction.vue')
      },
      {
        path: '/about-culture',
        name: 'culture',
        component: () => import('../views/About-culture.vue')
      },
      {
        path: '/about-strategy',
        name: 'strategy',
        component: () => import('../views/About-strategy.vue')
      },
      {
        path: '/about-sharing',
        name: 'sharing',
        component: () => import('../views/About-sharing.vue')
      },
      {
        path: '/about-recruitment',
        name: 'recruitment',
        component: () => import('../views/About-recruitment.vue')
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
